package com.wk.myannotation;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.dhht.annotationlibrary.MyAnnotation;
import com.dhht.annotator.ViewById;

public class MainActivity extends AppCompatActivity {

    @ViewById( R.id.testBtn)
    public Button testBtn ;
    @ViewById(value = R.id.showMsgTv)
    public TextView showMsgTv ;// 重要  ,不能是 private

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        MyAnnotation.injectView(this);

        showMsgTv.setText("注解测试成功...");

        testBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                showMsgTv.setText("1111111111111111111...");
            }
        });
    }
}
